namespace Shumei.EFCore.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class change1 : DbMigration
    {
        public override void Up()
        {
            //DropForeignKey("dbo.UserCourses", "User_account", "dbo.Users");
            //DropForeignKey("dbo.UserCourses", "Course_Id", "dbo.Courses");
            //DropIndex("dbo.UserCourses", new[] { "User_account" });
            //DropIndex("dbo.UserCourses", new[] { "Course_Id" });
            AddColumn("dbo.Courses", "User_account", c => c.String(maxLength: 20, storeType: "nvarchar"));
            CreateIndex("dbo.Courses", "User_account");
            AddForeignKey("dbo.Courses", "User_account", "dbo.Users", "account");
            //DropTable("dbo.UserCourses");
        }
        
        public override void Down()
        {
            //CreateTable(
            //    "dbo.UserCourses",
            //    c => new
            //        {
            //            User_account = c.String(nullable: false, maxLength: 20, storeType: "nvarchar"),
            //            Course_Id = c.Int(nullable: false),
            //        })
            //    .PrimaryKey(t => new { t.User_account, t.Course_Id });
            
            //DropForeignKey("dbo.Courses", "User_account", "dbo.Users");
            //DropIndex("dbo.Courses", new[] { "User_account" });
            //DropColumn("dbo.Courses", "User_account");
            //CreateIndex("dbo.UserCourses", "Course_Id");
            //CreateIndex("dbo.UserCourses", "User_account");
            //AddForeignKey("dbo.UserCourses", "Course_Id", "dbo.Courses", "Id", cascadeDelete: true);
            //AddForeignKey("dbo.UserCourses", "User_account", "dbo.Users", "account", cascadeDelete: true);
        }
    }
}
